calculation of visible cels only